/** \gr_script.h Stack-based bytecode compiler and interpreter
 *
 *  The language has a set of specified types. It lacks the capability to define your own types.
 *  C++ classes are mapped to scripting context in a straigthforward style.
 *
 *  Internal Types: int|double|vec2|vec3|vec4|bool|string|object|dictionary
 *  Predefined objects:
 *  mesh - a
 *  allocate new temporary  objects by: 
 *  All output vars must be specified implicitly at the start of evaluation.
 *  A script may modify input objects if the operation is allowed.
 * 
 *  Inputs:
 *   
 *  // Attach property: attach a new property (a random number) to each vertex of input mesh
 *  // There are two types of data attached to vertex: channel data (for each vertex of mesh)
    // and properties (allocated only by specification)
 *  input mesh : Mesh
 *   
 *  // Since we are adding a value for each vertex, it would make sense to actuallly add a
 *  // channel for mesh vertices in stead of a new property -> mesh.vertices.addChannel("rand")
 *  //Add input
 *  // mesh.vertices is an iteratable interface to mesh vertices
 *  for v in mesh.vertices do  // get sequence over mesh vertex references - this an accessor for per vertex data
        addProperty(v, "Rand", rand()) // add a key-valuepair data for specific vertex
    
 *  // another possible formulation
 *  for i in range(0, mesh.vertices.count):
        let v = mesh.vertices(i)
        addProperty(v, "Rand", rand())
 *
 *
 * // A two script pass 1: define a group of meshes
 *                 pass 2: define an operation on these meshes
 *
 * split.gsc=

 * let allMeshes =  input MeshGroup     // extract the first MeshGroup input from external env, for example Scene.meshes (an accessor that implements the meshgroup interface)
 * let bounds = input Geometry // Geometry objects can be used as members in various operations: child members: OrientedCircle, Mesh, etc.
 * let group =  output MeshGroup // Creates a new object in env by the name of group
 * 
 * // example function definition
 *   // parsing: if let has more than one var after it i
 *   let addIf mesh group = 
        if intersects(mesh, geometry) then
            group.add(mesh)
            "Added mesh" + mesh  // Explicit return value
        else
            "Did not add mesh" + mesh
 *
 *   for mesh in allMeshes do
        log addIf mesh 
        
*/

#pragma once


namespace gr{

/*
 * lex: str->tokens
 * parse: tokens -> expr_tree
 * compile: expr_tree -> adr_code
 * eval: env adr_code -> 
*/
}